﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace MDF.DataHelper.BussinessObject.UsersBO
{
    [DataContract]
    public class UserProfile
    {
        [DataMember]
        public int UserId { get; set; }
        [DataMember]
        public int ManagerID { get; set; }
        [DataMember]
        public string ManagerName { get; set; }
        [DataMember]
        public string GroupName { get; set; }
        [DataMember]
        public string UserName { get; set; }
        [DataMember]
        public string Name { get; set; }
        [DataMember]
        public string Email { get; set; }
        [DataMember]
        public string Phone { get; set; }
        [DataMember]
        public DateTime Birthday { get; set; }
        [DataMember]
        public string Sex { get; set; }
        [DataMember]
        public string Address { get; set; }
        [DataMember]
        public string Avatar { get; set; }
        [DataMember]
        public string Domain { get; set; }
        [DataMember]
        public bool IsLocked { get; set; }
        [DataMember]
        public bool IsConfirmed { get; set; }
        [DataMember]
        public int Total { get; set; }
        [DataMember]
        public DateTime CreatedDate { get; set; }
        [DataMember]
        public DateTime LastLogined { get; set; }
        

        public List<string> Roles = new List<string>();

        public List<string> Groups = new List<string>();
        public List<int> Childs;

        public bool IsInRoles(string roles)
        {
            return Roles.Exists(m => roles.IndexOf(m) > -1);
        }
    }
}
